package Nisha.inheritance;
abstract class AbstractParent
{
	private String name= "Nisha";
	public String getName()
	{
		return this.name;
	}
	public abstract void PrintName();
	
}

class AbstractChild extends AbstractParent
{

	@Override
	public void PrintName() {
		System.out.println(this.getName());
		
	}
	
}
class Parent
{
	private String name = "parent";
	public String getName()
	{
		System.out.println("in parent");
		return this.name;
	}
}

class Child extends Parent
{
	private String name= "child";
	public String getName()
	{
		System.out.println("in child");
		return this.name;
	}
	
}
public class InheritanceDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
	Parent p = new Parent();
	
	Child c = new Child();
	Parent p1 = new Child();
	//AbstractChild ac = new AbstractChild();
	AbstractParent ac = new AbstractChild();
	System.out.println(ac.getName());
	System.out.println(p.getName() +" "+c.getName()+" "+p1.getName());


	}

}
